package com.bootdo.system.controller;

import com.bootdo.system.domain.ContentDO;
import com.bootdo.system.service.ContentService;
import com.bootdo.system.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.List;

@ResponseBody
@Controller
public class ZixunConreoller {

    @Autowired
    private ContentService contentService;

    @GetMapping("/zixun")
    public R zixunPage() {

        List<ContentDO> contentDOS = contentService.list(new HashMap<>());

        return R.ok().put("contentDOS", contentDOS);
    }

    @GetMapping("/blogContent")
    public R blogContentPage(Long cid) {


        return R.ok().put("contentDO",contentService.get(cid));
    }
}
